#include <iostream>
#include <set>
#include <vector>
#include <unordered_map>

using namespace std;
const int N = 2e5 + 10;
struct node
{
    int l, r, val;
    bool operator< (const node& d) const
    {
        if (l == d.l) return r < d.r;
        return l < d.l;
    }
};
unordered_map<int, int> mp;
set<node> st;

int main()
{
    st.insert({ 0, N, 0 });
    mp[0] = N + 1;
    int q; cin >> q;
    while (q--)
    {
        int l, r, val; cin >> l >> r >> val;
        node p = { l, N, 0 };
        auto L = st.lower_bound(p);
        L--;
        int l1 = L->l, r1 = L->r, val1 = L->val;
        p = { r + 1, N, 0 };
        auto R = st.lower_bound(p);
        R--;
        int l2 = R->l, r2 = R->r, val2 = R->val;
        vector<node> del;
        for (auto t = L; ; t++)
        {
            int l3 = t->l, r3 = t->r, val3 = t->val;
            del.push_back(*t);
            mp[val3] -= r3 - l3 + 1;
            if (mp[val3] == 0) mp.erase(val3);
            if (t == R) break;
        }
        for (auto t : del)
        {
            st.erase(t);
        }
        if (l1 < l)
        {
            st.insert({ l1, l - 1, val1 });
            mp[val1] += l - l1;
        }
        if (r2 > r)
        {
            st.insert({ r + 1, r2, val2 });
            mp[val2] += r2 - r;
        }
        st.insert({ l, r, val });
        mp[val] += r - l + 1;
        cout << mp.size() << endl;
    }
    return 0;
}   